<template>
	<view v-if="isShowModal">
		<view class="masking" v-if="showMasking" :style="{'background-color': bgColor}"></view>
		<view class="model-wraper">
			<view class="modal-body">
				<slot>
					<image class="pic" src="../../static/demo/demo2.jpg"></image>
					<view class="text">
						<view class="warn_text">
							严禁发表以下言论
						</view>
						<view class="text_list">
							1,涉及黄色，政治，广告及骚扰信息
						</view>
						<view class="text_list">
							2,涉及人身攻击  
						</view>
						<view class="text_list">
							3,留联系方式，透漏他人信息
						</view>
						<view class="text_list">
							已经核实将被封禁，情节严重者永久封禁
						</view>
					</view>
				</slot>
			</view>
			<view>
				<view class="btn" @click="handleCancel">朕知道了</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			// 是否显示蒙层
			showMasking: {
				type: Boolean,
				default: true
			},
			// 蒙层背景色
			bgColor: {
				type: String,
				default: 'rgba(0,0,0,.6)'
			},
			// 模态框标题
			modalTitle: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				isShowModal: true 
			}
		},
		methods: {
			handleCancel() {
				this.isShowModal = false
			}
		}
	}
</script>

<style scoped>
	.masking {
		height: 100vh;
		width: 100vw;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
	}
	.model-wraper {
		width: 600rpx;
		background-color: #fff;
		border-radius: 16rpx;
		position: absolute;
		z-index: 1000;
		top: 50%;
		left: 50%;
		transform: translate(-50%,-50%);
		box-shadow: #dcdcdc 0px 0px 20rpx;
	}
	.modal-title {
		height: 90rpx;
		line-height: 90rpx;
		width: 100%;
		text-align: center;
		font-size: 32rpx;
		color: #666;
	}
	.modal-body {
		padding: 60rpx 30rpx 80rpx 30rpx;
	}
	.btn {
		width: 100%;
		height: 90rpx;
		text-align: center;
		line-height: 90rpx;
		font-size: 32rpx;
		float: left;
		border-top: 1rpx solid #ddd;
		background-color: #f9f23c;
	}
	.btn.cancel {
		width: 100%;
		border-right: 1rpx solid #dcdcdc;
	}
	.pic{
		width: 100%;
		height: 300rpx;
	}
	.warn_text{
		color: #f9f33a;
		text-align: center;
		padding: 15rpx 0;
	}
</style>
